<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-model修饰符的使用</title>
</head>
<body>

<div id="app">
  <h1>v-model修饰符的使用</h1>
  <h2>一、lazy 懒加载，失去焦点或者按回车后生效</h2>
  <input type="text" v-model.lazy="hobby">
  <h2>{{hobby}}</h2>
  <hr>

  <h2>二、number 数字类型，不需要转换了，默认是string类型</h2>
  <input type="text" v-model.number="number">
  <h2>{{typeof number}}---{{number}}</h2>
  <hr>

  <h2>三、trim 去掉首尾的空格空格</h2>
  <input type="text" v-model.trim="name">
  <h2>你输入的名字是:{{name}}</h2>

</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      hobby: '',
      name: '',
      number: 0
    }
  })
</script>
</body>
</html>
